package com.msl.base;

import android.app.Activity;
import android.content.SharedPreferences;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.view.Gravity;
import android.view.WindowManager;
import androidx.fragment.app.FragmentActivity;
import com.google.gson.Gson;
import com.msl.R;
import com.msl.dialog.WaitDialog;
import java.util.concurrent.TimeUnit;
import okhttp3.OkHttpClient;


//BaseFragmentActivity
public  class BaseFragmentActivity extends FragmentActivity {

    //app配置信息
    protected SharedPreferences mSharedPreferences;
    protected SharedPreferences.Editor mEditor;
    protected Gson gson = null;
    protected Activity context=null;
    protected WaitDialog waitDialog;
    protected OkHttpClient client;
    protected String result="";



    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);  // 设置activity显示只能竖屏
        gson = new Gson();
        context = this;
        waitDialog = new WaitDialog(context , R.style.Dialog1);
        WindowManager.LayoutParams lp = waitDialog.getWindow().getAttributes();
        lp.gravity = Gravity.CENTER;
        //client = new OkHttpClient();
        client = new OkHttpClient.Builder()
                .retryOnConnectionFailure(true)
                .connectTimeout(90, TimeUnit.SECONDS)//设置连接超时时间
                .readTimeout(90, TimeUnit.SECONDS)//设置读取超时时间
                .build();
    }






    @Override
    protected void onDestroy() {
        super.onDestroy();

    }

    @Override
    protected void onResume() {
        super.onResume();
    }


    @Override
    protected void onPause() {
        super.onPause();
    }




}
